/* 加载 */
let loadingBoxEl = null;
function loadingBoxCreate(title){
    loadingBoxEl = document.createElement('div');
    loadingBoxEl.className = 'loading-box';
    const loadingMainScrollBarEl = document.createElement('div');
    loadingMainScrollBarEl.className = 'loading-main-scroll-bar';
    const loadingMainBoxTextEl = document.createElement('div');
    loadingMainBoxTextEl.className = 'loading-main-box-text';
    loadingMainBoxTextEl.innerText = title;
    loadingBoxEl.appendChild(loadingMainScrollBarEl);
    loadingBoxEl.appendChild(loadingMainBoxTextEl);
}

//开启
function loadingBoxShow(){
    publicPreventScrolling();
    loadingBoxEl.style.display = 'flex';
    setTimeout(() => {
        loadingBoxEl.style.opacity = '1';
    });
}

//关闭
function loadingBoxClose(){
    publicAllowScrolling();
    loadingBoxEl.style.opacity = '0';
    setTimeout(() => {
        loadingBoxEl.style.display = 'none';
    }, 300);
}

function loadingBoxRun(title = '正在拼命加载中...'){
    loadingBoxCreate(title)
    document.body.appendChild(loadingBoxEl);
}